package com.black.app.domain.req.my.myshoppingcar;

import cn.hutool.core.util.StrUtil;
import com.black.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@ApiModel(value = "AppShoppingCarQueryReq", description = "购物车查询请求对象")
public class AppShoppingCarQueryReq extends PageAbstructReq {

    /**
     * 用户id
     */
    @ApiModelProperty(value = "用户id", position = 1)
    private Integer userId;

    /**
     * 商品名
     */
    @ApiModelProperty(value = "商品名", position = 2)
    private String productName;

    /**
     * 是否售卖
     */
    @ApiModelProperty(value = "是否售卖", position = 3)
    private Integer saleNot;

    /**
     * 排序
     * @return
     */
    @ApiModelProperty(hidden = true)
    @Override
    public String getOrderBy() {
        if(StrUtil.isNotBlank(super.getOrderByColumn())){
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
